import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
import User from '../components/User'
import Register from '../components/Register'
import Welcome from '../components/Welcome'
import Shopping from '../components/Shopping'
import Goods from '../components/display/Goods'
import Address from '../components/display/Address'
import Message from '../components/Message'
import Administration from '../components/Adminstration'
import Order from '../components/Order'
import Inventory from '../components/Inventory'
import Jingli from '../components/Jingli'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    { path: '/register', component: Register },
    { path: '/jingo', component: Jingli },
    {
      path: '/use',
      component: User,
      redirect: '/welcome',
      children: [
        {
          path: '/welcome',
          name: 'wel',
          component: Welcome
        },
        {
          path: '/shopping',
          name: 'shop',
          component: Shopping
        },
        {
          path: '/goods',
          name: 'good',
          component: Goods
        },
        {
          path: '/address',
          name: 'add',
          component: Address
        },
        {
          path: '/administration',
          name: 'admin',
          component: Administration
        },
        {
          path: '/order',
          name: 'ord',
          component: Order
        },
        {
          path: '/inventory',
          name: 'invent',
          component: Inventory
        },
        {
          path: '/message',
          name: 'mess',
          component: Message
        }
      ]
    }
  ]
})

export default router
